package com.sun.weekend.util;

import android.util.SparseArray;
import android.view.View;

public class ViewHolder{

	@SuppressWarnings("unchecked")
	public static View getView(View convertView,int id)
	{
		SparseArray<View> mViews = (SparseArray<View>) convertView.getTag();
		if (mViews == null) {
			mViews = new SparseArray<View>();
			convertView.setTag(mViews);
		}
		View view = mViews.get(id);
		if (view == null) {
			view = convertView.findViewById(id);
			mViews.put(id, view);
		}
		return view;
	}
}